In this article I’m trying to explain the difference/similarities between dynamic programming and divide and conquer approaches based on two examples: binary search and minimum edit distance (Levenshtein distance)....
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum....
We’re going to create a website that will translate text into multiple languages using Artificial Intelligence(AI). We’ll use Flask framework for the Front end and Azure Cognitive Services(collection of AI services) for the Back end....
An array is given, find length of the subarray having maximum sum....
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write a function that takes an array as argument and returns the length of the longest bitonic subsequence. A sequence, sorted in increasing order is considered Bitonic with the decreasing part as empty. Similarly, decreasing order sequence is considered Bitonic with the increasing part as empty. Examples:...
Given a set of non-negative integers and a value sum, the task is to check if there is a subset of the given set whose sum is equal to the given sum....
Given an array arr[] where each element represents the max number of steps that can be made forward from that index. The task is to find the minimum number of jumps to reach the end of the array starting from index 0....
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any row in the array b[][] such that the total score can be maximized and the score for each pair is calculated as the total indexes at which values of both rows are identical....
Given a positive integer N, the task is to find the number of all N-digit numbers whose adjacent digits have equal Greatest Common Divisor(GCD)....
Oracle came to our campus in Sept 2020, for a server technology profile. All rounds were audio and video proctored. The entire interview process was on zoom meetings. It was a very smooth virtual experience. There were counter rooms inside zoom meetings for post and pre-interview sessions....
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation....
There are many ways of classifying algorithms and a few of them are shown below:...